Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
Node.js cómo tomar un argumento de método de clase y usarlo para llamar a "this.argument"

hola chicos tengo una pregunta Así que tengo una clase en nodejs y en el constructor inicializo algunos contratos inteligentes de uniswap. Sin embargo, estoy creando una función que toma como parámetro uno de los contratos inteligentes que inicializo en el constructor. sin embargo, cuando trato de llamar al método y pasar uniswapFactoryContract como un argumento llamado "echangeName", el nodo toma this.exchangeName tal como está, pero en lugar de tomar exchangeName como el argumento que paso, lo toma como this.echangeName no esto .ElNombreDelArgIPPasa. Mi código está a continuación. ¿Alguien podría ayudarme o proporcionarme otra forma?

 module.exports =class Registry { constructor() { //default token addresses this.DAI = "0x6b175474e89094c44da98b954eedeac495271d0f"; this.WETH = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"; //default provided exhange addressses this.UniswapFactoryAddress = "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f"; this.UniswapRouterAddress = "0xf164fC0Ec4E93095b804a4795bBe1e041497b92a"; } //when i call this in index.js i specifcy the uniswapFactoryaddress as the exchange name paramrer async getTokenPairSddress(addressToken0, addressToken1, exchangeName) { //this line throws the error it thinks i want this.echange name instead of //this.uniswapFactoryContract const pairAddress = await this.exchangeName.methods.getPair(addressToken0, addressToken1).call(); return pairAddress; }

}

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!